package com.example.demo.common.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @Author: 王文龙
 * @Date: 2020/6/1918:16
 * @Version: 1.0
 * @Describe: 描述:mvc配置
 */
@Configuration
public class RequestConfig implements WebMvcConfigurer {

    @Resource
    private RequestUrlInterceptor requestUrlInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加拦截器，配置拦截地址
        registry.addInterceptor(requestUrlInterceptor).addPathPatterns("/**");
    }
}
